// @flow

// function sum (a: number, b: number) {
//   return a + b
// }

// sum(100, 100)

// sum('100', '100')

// sum('100', 100)

const a: string = 'foobar'
const b: number = Infinity //无穷大

const arr1: Array<number> = [1,2,3]
const arr2: number[] = [1,2,3]
const arr3: [number, string] = [1,'2']

// 限制函数接受2个参数
function foo(callbak: (string, number) => void) {
    callbak('string', 100)
}